package com.muyu.danmo.controller;

import com.muyu.common.core.domain.Result;
import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.danmo.domain.dto.PersonAddDTO;
import com.muyu.danmo.service.IDanmoInformationCopy1Service;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Administrator
 */
@RestController
@RequestMapping("/person")
@Slf4j
@RequiredArgsConstructor
public class PersonController {

    private final IDanmoInformationCopy1Service danmoInformationCopy1Service;

    /**
     * 新增会员信息
     * @param personAddDTO
     * @return
     */
    @PostMapping("/add")
    public Result<String> add(@RequestBody PersonAddDTO personAddDTO){
        personAddDTO.setUserId(SecurityUtils.getUserId());
        danmoInformationCopy1Service.add(personAddDTO);
        return Result.success("新增成功");
    }


}
